package com.jsh.wiki.controller;

import com.jsh.wiki.req.EbookReq;
import com.jsh.wiki.resp.CommonResp;
import com.jsh.wiki.resp.EbookResp;
import com.jsh.wiki.service.EbookService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/ebook")
public class EbookController {
    @Resource
    private EbookService ebookService;


    @GetMapping("/list")
    public CommonResp ebook(EbookReq ebookReq){
        CommonResp< List<EbookResp>> ebookCommonResp = new CommonResp<>();
        List<EbookResp> list = ebookService.list(ebookReq);
        ebookCommonResp.setContent(list);
       return ebookCommonResp;
    }
}
